<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   主题：从源代码编译R时图形设备不被支持（如libpng、cairo/pango）  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/topic/17737/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466438795: Accept with keywords: (title(0.5):主题,编译,论坛,图形,源代码,时, topn(0.2):软件应用,装上,路径,帖子,编译,编译器,图形,选项,文件,用户名,自定义,主站,和库,服务器,源代码,C++,问题,密码,总计,平台,环境变量,版主,头文件,配置文件,标准,主题,系统,论坛,软件,讨论区).-->
 </head>
 <body class="topic bbpress single single-topic postid-17737 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    主题：从源代码编译R时图形设备不被支持（如libpng、cairo/pango）
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-17737 topic type-topic status-publish hentry" id="post-17737">
        <header class="entry-header">
         <h1 class="entry-title">
          从源代码编译R时图形设备不被支持（如libpng、cairo/pango）
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div class="bbp-breadcrumb">
           <p>
            <a class="bbp-breadcrumb-home" href="http://cos.name/cn/">
             COS论坛 | 统计之都
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-root" href="http://cos.name/cn/forums/">
             讨论区
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/">
             软件应用
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/r-language/">
             S-Plus &amp; R语言
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <span class="bbp-breadcrumb-current">
             从源代码编译R时图形设备不被支持（如libpng、cairo/pango）
            </span>
           </p>
          </div>
          <div class="bbp-template-notice info">
           <p class="bbp-topic-description">
            该主题包含 17 条回复，7个帖子，最后由
            <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
             <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=14&amp;d=monsterid&amp;r=g"/>
            </a>
            <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
             谢益辉
            </a>
            在
            <a href="http://cos.name/cn/topic/17737/page/2/#post-283966" title="回复：从源代码编译R时图形设备不被支持（如libpng、cairo/pango）">
             6 年, 4 月 之前
            </a>
            更新。
           </p>
          </div>
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 15 个帖子 - 1 到 15（总计 18 个）
           </div>
           <div class="bbp-pagination-links">
            <span class="page-numbers current">
             1
            </span>
            <a class="page-numbers" href="http://cos.name/cn/topic/17737/page/2/">
             2
            </a>
            <a class="next page-numbers" href="http://cos.name/cn/topic/17737/page/2/">
             →
            </a>
           </div>
          </div>
          <ul class="forums bbp-replies" id="topic-17737-replies">
           <li class="bbp-header">
            <div class="bbp-reply-author">
             作者
            </div>
            <!-- .bbp-reply-author -->
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-header -->
           <li class="bbp-body">
            <div class="bbp-reply-header" id="post-17737">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月24日 下午2:38
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-17737">
               1 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-17737 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-1 user-id-1 topic-author post-17737 topic type-topic status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我昨天突然发现原来我们这个网站服务器上是可以编译安装R的，只是有个小问题没解决，就是我不知道如何把libpng和cairo放进去。我看了一下configure的帮助，是这样的：
              </p>
              <pre class="highlight ">***@*** [~/etc/R]# ./configure --help
`configure' configures R 2.10.1 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR          info documentation [DATAROOTDIR/info]
  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR           man documentation [DATAROOTDIR/man]
  --docdir=DIR           documentation root [DATAROOTDIR/doc/R]
  --htmldir=DIR          html documentation [DOCDIR]
  --dvidir=DIR           dvi documentation [DOCDIR]
  --pdfdir=DIR           pdf documentation [DOCDIR]
  --psdir=DIR            ps documentation [DOCDIR]

R installation directories:
  --libdir=DIR        R files to R_HOME=DIR/R [EPREFIX/$LIBnn]
    rdocdir=DIR       R doc files to DIR      [R_HOME/doc]
    rincludedir=DIR   R include files to DIR  [R_HOME/include]
    rsharedir=DIR     R share files to DIR    [R_HOME/share]

X features:
  --x-includes=DIR    X include files are in DIR
  --x-libraries=DIR   X library files are in DIR

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-R-profiling    attempt to compile support for Rprof() [yes]
  --enable-memory-profiling
                          attempt to compile support for Rprofmem(),
                          tracemem() [no]
  --enable-R-framework[=DIR]
                          MacOS X only: build R framework (if possible), and
                          specify its installation prefix [yes,
                          /Library/Frameworks]
  --enable-R-shlib        build the shared/dynamic library 'libR' [no]
  --enable-R-static-lib   build the static library 'libR.a' [no]
  --enable-BLAS-shlib     build BLAS into a shared/dynamic library [perhaps]
  --enable-maintainer-mode
                          enable make rules and dependencies not useful (and
                          maybe confusing) to the casual installer [no]
  --enable-strict-barrier provoke compile error on write barrier violation
                          [no]
  --enable-prebuilt-html  build static HTML help pages [no]
  --enable-static[=PKGS]  (libtool) build static libraries [default=no]
  --enable-shared[=PKGS]  (libtool) build shared libraries [default=yes]

  --disable-largefile     omit support for large files
  --disable-nls           do not use Native Language Support

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-blas             use system BLAS library (if available), or specify
                          it [no]
  --with-lapack           use system LAPACK library (if available), or specify
                          it [no]
  --with-readline         use readline library [yes]
  --with-aqua             MacOS X only: use Aqua (if available) [yes]
  --with-tcltk            use Tcl/Tk (if available), or specify its library
                          dir [yes]
  --with-tcl-config=TCL_CONFIG
                          specify location of tclConfig.sh []
  --with-tk-config=TK_CONFIG
                          specify location of tkConfig.sh []
  --with-cairo            use cairo (and pango) if available [yes]
  --with-libpng           use libpng library (if available) [yes]
  --with-jpeglib          use jpeglib library (if available) [yes]
  --with-system-zlib      use system zlib library (if available) [no]
  --with-system-bzlib     use system bzlib library (if available) [no]
  --with-system-pcre      use system PCRE library (if available) [no]
  --with-system-xz        use system xz (lzma) library (if available) [yes]
  --with-valgrind-instrumentation
                          Level of additional instrumentation for Valgrind
                          (0/1/2) [0]
  --with-recommended-packages
                          use/install recommended R packages [yes]
  --with-ICU              use ICU library [yes]
  --with-pic              try to use only PIC/non-PIC objects [default=use
                          both]
  --with-x                use the X Window System
  --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
  --without-libpth-prefix     don't search for libpth in includedir and libdir
  --with-included-gettext use the GNU gettext library included here
  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
  --without-libintl-prefix     don't search for libintl in includedir and libdir

Some influential environment variables:
  R_PRINTCMD  command used to spool PostScript files to the printer
  R_PAPERSIZE paper size for the local (PostScript) printer
  R_BATCHSAVE set default behavior of R when ending a session
  MAIN_CFLAGS additional CFLAGS used when compiling the main binary
  SHLIB_CFLAGS
              additional CFLAGS used when building shared libraries
  MAIN_FFLAGS additional FFLAGS used when compiling the main binary
  SHLIB_FFLAGS
              additional FFLAGS used when building shared libraries
  MAIN_LD     command used to link the main binary
  MAIN_LDFLAGS
              flags which are necessary for loading a main program which will
              load shared library modules (DLLs) at runtime
  CPICFLAGS   special flags for compiling C code to be turned into a shared
              library.
  FPICFLAGS   special flags for compiling Fortran code to be turned into a
              shared library.
  FCPICFLAGS  special flags for compiling Fortran 95 code to be turned into a
              shared library.
  SHLIB_LD    command for linking shared libraries which contain object files
              from a C or Fortran compiler only
  SHLIB_LDFLAGS
              special flags used by SHLIB_LD
  DYLIB_LD    command for linking dynamic libraries which contain object files
              from a C or Fortran compiler only
  DYLIB_LDFLAGS
              special flags used for make a dynamic library
  CXXPICFLAGS special flags for compiling C++ code to be turned into a shared
              library
  SHLIB_CXXLD command for linking shared libraries which contain object files
              from a C++ compiler
  SHLIB_CXXLDFLAGS
              special flags used by SHLIB_CXXLD
  SHLIB_FCD   command for linking shared libraries which contain object files
              from the Fortran 95 compiler
  SHLIB_FCLDFLAGS
              special flags used by SHLIB_FCLD
  TCLTK_LIBS  flags needed for linking against the Tcl and Tk libraries
  TCLTK_CPPFLAGS
              flags needed for finding the tcl.h and tk.h headers
  MAKE        make command
  TAR         tar command
  R_BROWSER   default browser
  R_PDFVIEWER default PDF viewer
  BLAS_LIBS   flags needed for linking against external BLAS libraries
  LAPACK_LIBS flags needed for linking against external LAPACK libraries
  LIBnn       'lib' or 'lib64' for dynamic libraries
  SAFE_FFLAGS Safe Fortran 77 compiler flags for e.g. dlamc.f
  r_arch      Use architecture-dependent subdirs with this name
  DEFS        C defines for use when compiling R
  JAVA_HOME   Path to the root of the Java environment
  R_SHELL     shell to be used for shell scripts, including 'R'
  YACC        The `Yet Another C Compiler' implementation to use. Defaults to
              the first program found out of: `bison -y', `byacc', `yacc'.
  YFLAGS      The list of arguments that will be passed by default to $YACC.
              This script will default YFLAGS to the empty string to avoid a
              default value of `-d' given by some make applications.
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L&lt;lib dir&gt; if you have libraries in a
              nonstandard directory &lt;lib dir&gt;
  LIBS        libraries to pass to the linker, e.g. -l&lt;library&gt;
  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I&lt;include dir&gt; if
              you have headers in a nonstandard directory &lt;include dir&gt;
  CPP         C preprocessor
  F77         Fortran 77 compiler command
  FFLAGS      Fortran 77 compiler flags
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CXXCPP      C++ preprocessor
  OBJC        Objective C compiler command
  OBJCFLAGS   Objective C compiler flags
  XMKMF       Path to xmkmf, Makefile generator for X Window System
  FC          Fortran compiler command
  FCFLAGS     Fortran compiler flags

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to &lt;r-bugs@R-project.org&gt;.
</pre>
              <p>
               我猜应该跟–with-libpng和–with-cairo有关，但从configure的结果来看，R是可以找到libpng的位置的：
              </p>
              <pre class="highlight ">***@*** [~/etc/R]# ./configure --prefix=$HOME/bin/R
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
loading site script './config.site'
loading build-specific script './config.site'
....
....
checking whether pkg-config knows about cairo and pango... no
checking whether pkg-config knows about cairo... no
....
....
checking if jpeglib version &gt;= 6b... yes
checking for jpeg_destroy_compress in -ljpeg... yes
checking for main in -lz... yes
checking if libpng version &gt;= 1.0.5... yes
checking for png_create_write_struct in -lpng... yes
....
....

R is now configured for x86_64-unknown-linux-gnu

  Source directory:          .
  Installation directory:    /***/bin/R

  C compiler:                gcc -std=gnu99  -g -O2
  Fortran 77 compiler:       gfortran  -g -O

  C++ compiler:              g++  -g -O2
  Fortran 90/95 compiler:    gfortran -g -O
  Obj-C compiler:

  Interfaces supported:      X11
  External libraries:        readline
  Additional capabilities:   PNG, JPEG, TIFF, NLS
  Options enabled:           shared BLAS, R profiling, Java

  Recommended packages:      yes

configure: WARNING: you cannot build DVI versions of the R manuals
configure: WARNING: you cannot build DVI versions of all the help pages
configure: WARNING: you cannot build PDF versions of the R manuals
configure: WARNING: you cannot build PDF versions of all the help pages</pre>
              <p>
               再往下make和make install能装上R，但
              </p>
              <pre class="highlight ">&gt; capabilities()
    jpeg      png     tiff    tcltk      X11     aqua http/ftp  sockets
   FALSE    FALSE    FALSE    FALSE    FALSE    FALSE     TRUE     TRUE
  libxml     fifo   cledit    iconv      NLS  profmem    cairo
    TRUE     TRUE     TRUE     TRUE     TRUE    FALSE    FALSE
</pre>
              <p>
               可以看到几种位图设备都不支持，包括png。
              </p>
              <p>
               我自己又尝试专门下载libpng编译了，并把安装路径的include位置传给–with-libpng，也不管用。请问这是咋回事呢？
              </p>
              <pre class="highlight ">&gt; Sys.info()
                              sysname                               release
                              "Linux"         "2.6.28-10.7.intel.IGB.BHsmp"
                              version                              machine   
"#1 SMP Thu Aug 13 21:52:24 MDT 2009"                             "x86_64"   
</pre>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282025">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月24日 下午11:57
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282025">
               2 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282025 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-2 user-id-88774 post-282025 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/88774/" rel="nofollow" title="查看颜林林的档案">
               <img src="http://sdn.geekzu.org/avatar/0401b41c54beb67d8387daef8cf8f47a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/88774/" rel="nofollow" title="查看颜林林的档案">
               颜林林
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               R的Makefile做得比较“智能”，在系统中没有png库时，即使指定了–with-libpng，它也会直接忽略，从而导致最后的编译结果不支持png。其它特性类似。
              </p>
              <p>
               –with-libpng后面如果要指定路径，应该指定的是include上面一级目录。比如在编译libpng时，用了configure –prefix=/libpng-output/，那么在make &amp;&amp; make install之后，libpng的头文件被放到/libpng-output/include/，而编译好的库文件被放到/libpng-output/lib/。所以在指定时，应该使用/libpng-output/，使编译器能够同时找到头文件和库文件。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282033">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月25日 上午6:36
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282033">
               3 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282033 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-3 user-id-1 topic-author post-282033 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我感觉R根本就不管–with-libpng参数，我按你说的路径传给它也没用……真是怪了
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282041">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月25日 上午11:13
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282041">
               4 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282041 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-4 user-id-88774 post-282041 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/88774/" rel="nofollow" title="查看颜林林的档案">
               <img src="http://sdn.geekzu.org/avatar/0401b41c54beb67d8387daef8cf8f47a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/88774/" rel="nofollow" title="查看颜林林的档案">
               颜林林
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我编译过没问题，都没有指定libpng，应该是我的系统装过。要查最终编译是否成功支持它，以及为什么不支持，可以在执行完configure之后，查看config.log文件。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282045">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月25日 下午1:46
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282045">
               5 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282045 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-5 user-id-95032 post-282045 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/95032/" rel="nofollow" title="查看lyxmoo的档案">
               <img src="http://sdn.geekzu.org/avatar/8eac6de01856f21023a1fc3b6276f062?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/95032/" rel="nofollow" title="查看lyxmoo的档案">
               lyxmoo
              </a>
              <br/>
              <div class="bbp-author-role">
               版主
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我编译过，也没有问题，
              </p>
              <p>
               你可以使用这样的命令：
              </p>
              <p>
               nohup ./configure –prefix=/usr …… &amp;
              </p>
              <p>
               然后你再使用  tail -f nohup.out 查看它执行结束。
              </p>
              <p>
               把 nohup.out 发给我，或许我可以帮你看看哪里出问题了（在统计学领域，我比较擅长*NIX系统） 。 [s:12]
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282083">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月26日 下午1:19
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282083">
               6 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282083 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-6 user-id-95032 post-282083 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/95032/" rel="nofollow" title="查看lyxmoo的档案">
               <img src="http://sdn.geekzu.org/avatar/8eac6de01856f21023a1fc3b6276f062?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/95032/" rel="nofollow" title="查看lyxmoo的档案">
               lyxmoo
              </a>
              <br/>
              <div class="bbp-author-role">
               版主
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               rpm -qa | grep pango
              </p>
              <p>
               rpm -qa | grep cairo
              </p>
              <p>
               应该有叫 pango-devel 和  cairo-devel 的包才对，这些包都可以在安装的CD上找的到。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282243">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月30日 下午9:54
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282243">
               7 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282243 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-7 user-id-1 topic-author post-282243 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我又自问自答了……
              </p>
              <p>
               经过几天的潜心研究，终于部分悟透了R的配置和编译过程。真相（我想象的）是这样：
              </p>
              <p>
               在configure中，–with-libpng和–with-cairo这些选项和别的软件不一样，那些C头文件和库文件的路径不是指定给这些选项的（其它很多软件的配置可以直接指定路径给这些选项，如subversion的–with-apr等）。
              </p>
              <p>
               第一，R是通过pkg-config去测试依赖的软件有没有安装以及头文件和库文件在什么位置，如：
              </p>
              <pre class="highlight ">***@cos.name [~/etc/R-2.10.1]# pkg-config --libs --cflags libpng
-I/usr/include/libpng12  -L/usr/lib -lpng12</pre>
              <p>
               如果装了libpng，则pkg-config能找到正确的include和lib文件夹的位置。我之前之所以出问题就是因为pkg-config –libs –cflags cairo出错了，原因是cairo依赖于fontconfig，而pkg-config找不到fontconfig的配置文件fontconfig.pc的位置，因此需要设置环境变量
              </p>
              <pre class="highlight ">export PKG_CONFIG_PATH=/usr/lib/pkgconfig/</pre>
              <p>
               这样cairo可以被pkg-config找到，R的./configure可以顺利通过。
              </p>
              <p>
               第二，如果要告诉R那些头文件和库文件的位置，则应该通过设置环境变量来实现，如
              </p>
              <pre class="highlight ">export CFLAGS='-I/usr/include/ -I/usr/include/cairo/ -I/usr/include/libpng12/ -I/usr/include/pango-1.0/pango/'
export LDFLAGS='-L/usr/lib64/ -L/usr/lib64/pango/1.5.0/modules/'</pre>
              <p>
               这些路径最终都传给了gcc，在make的过程中可以看到。
              </p>
              <p>
               楼上几位之所以能顺利安装可能是因为libpng和Cairo在标准的位置上，而我在这里一方面没有root权限，另一方面这个系统是64位的而且有些库不在标准的/usr/local/include下，得手工配置。
              </p>
              <p>
               我们的服务器上终于装上了R，故事至此结束。本菜鸟的大多数Linux知识都是拜R所赐，折腾了这么一通，现在wget，tar -zxf，./configure –prefix都敲得烂熟了，哈哈。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282245">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月31日 上午4:07
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282245">
               8 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282245 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-8 user-id-1 topic-author post-282245 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               高兴的太早了，新问题诞生了：
              </p>
              <pre class="highlight ">&gt; png('~/tmp/Rplot001.png')
&gt; plot(1)

(process:1577): Pango-WARNING **: No builtin or dynamically
loaded modules were found. Pango will not work correctly.
This probably means there was an error in the creation of:
  '/etc/pango/pango.modules'
You should create this file by running pango-querymodules.
Fontconfig error: Cannot load default config file

(process:1577): Pango-WARNING **: pango_shape called with bad font, expect ugly output

(process:1577): Pango-WARNING **: pango_font_get_glyph_extents called with bad font, expect ugly output

(process:1577): Pango-WARNING **: _pango_cairo_font_install called with bad font, expect ugly output
</pre>
              <p>
               呃，有人熟悉pango么……
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282250">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月31日 上午7:04
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282250">
               9 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282250 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-9 user-id-81532 post-282250 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/81532/" rel="nofollow" title="查看Ihavenothing的档案">
               <img src="http://sdn.geekzu.org/avatar/f09663fd5fc04bad5e5b09daddb86fe6?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/81532/" rel="nofollow" title="查看Ihavenothing的档案">
               Ihavenothing
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               字体问题？
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282283">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2009年12月31日 下午9:32
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282283">
               10 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282283 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-10 user-id-1 topic-author post-282283 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我也不知道，这问题对我来说太深了，我不想越过R再去研究别的包了……之所以想把这个png弄好，是因为在考虑搭一个Rweb平台，图形的输出设备计划用png。其实大多数时候用pdf()就可以了。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282292">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2010年1月1日 上午6:22
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282292">
               11 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282292 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-11 user-id-13526 post-282292 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/13526/" rel="nofollow" title="查看cloud wei的档案">
               <img src="http://sdn.geekzu.org/avatar/c756f0debd02bd11e1c0f1d2cf0beeb5?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/13526/" rel="nofollow" title="查看cloud wei的档案">
               cloud wei
              </a>
              <br/>
              <div class="bbp-author-role">
               版主
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我们可以用中科院的Web-R啊，他们的似乎可以输出png的:)
              </p>
              <p>
               此外，建立这个平台对硬件要求蛮高，不知我们的满足不~
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282293">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2010年1月1日 上午7:06
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282293">
               12 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282293 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-12 user-id-1 topic-author post-282293 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               他们是自己的机器，想怎么摆弄就怎么摆弄，装R容易。我们这台服务器上那些依赖的包都不能装在标准的位置，需要自定义，所以才麻烦重重。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282338">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2010年1月2日 下午9:18
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282338">
               13 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282338 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-13 user-id-6 post-282338 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/6/" rel="nofollow" title="查看Feng Li的档案">
               <img src="http://sdn.geekzu.org/avatar/3883ce88641c54fc57c55076c74577f7?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/6/" rel="nofollow" title="查看Feng Li的档案">
               Feng Li
              </a>
              <br/>
              <div class="bbp-author-role">
               版主
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               我猜你应该在每次启动R前执行
               <br/>
               export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
               <br/>
               export CFLAGS='-I/usr/include/ -I/usr/include/cairo/ -I/usr/include/libpng12/ -I/usr/include/pango-1.0/pango/'
               <br/>
               export LDFLAGS='-L/usr/lib64/ -L/usr/lib64/pango/1.5.0/m
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282339">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2010年1月2日 下午9:36
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282339">
               14 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282339 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-14 user-id-6 post-282339 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/6/" rel="nofollow" title="查看Feng Li的档案">
               <img src="http://sdn.geekzu.org/avatar/3883ce88641c54fc57c55076c74577f7?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/6/" rel="nofollow" title="查看Feng Li的档案">
               Feng Li
              </a>
              <br/>
              <div class="bbp-author-role">
               版主
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               –with-libpng 的作用是提供 –with-libpng=no 的选项的。 如果你确定要让–with-libpn=yes(默认), 你的libpeng的路径应该让R"猜到",或者你告诉R它在哪里。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-282372">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2010年1月4日 上午12:58
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/17737/#post-282372">
               15 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-282372 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-17737 bbp-reply-position-15 user-id-1 topic-author post-282372 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               <img src="http://sdn.geekzu.org/avatar/1022d8e6ebc94e8f6bca9a86cebe312a?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/1/" rel="nofollow" title="查看谢益辉的档案">
               谢益辉
              </a>
              <br/>
              <div class="bbp-author-role">
               站长
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               木有用……
              </p>
              <p>
               后来我发现设置了PKG_CONFIG_PATH之后，剩下的两个就不用设置了，因为pkg-config可以根据PKG_CONFIG_PATH找到CFLAGS和LDFLAGS。这些环境变量应该是供编译使用的，编译好了之后R应该就知道该上哪儿找pango和cairo等包了。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
           </li>
           <!-- .bbp-body -->
           <li class="bbp-footer">
            <div class="bbp-reply-author">
             作者
            </div>
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-footer -->
          </ul>
          <!-- #topic-17737-replies -->
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 15 个帖子 - 1 到 15（总计 18 个）
           </div>
           <div class="bbp-pagination-links">
            <span class="page-numbers current">
             1
            </span>
            <a class="page-numbers" href="http://cos.name/cn/topic/17737/page/2/">
             2
            </a>
            <a class="next page-numbers" href="http://cos.name/cn/topic/17737/page/2/">
             →
            </a>
           </div>
          </div>
          <div class="bbp-no-reply" id="no-reply-17737">
           <div class="bbp-template-notice">
            <p>
             您必须先登录才能回复该主题。
            </p>
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <div class="comments-area" id="comments">
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>